Skip to content

feat: refine work with membership info and other meta information #2341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 29, 2025

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Apr 7, 2025

Problem / Description

There are a few problems with the current adapter:

  • idCommitment is a stringified hex
  • getMembershipInfo doesn't return all available membership info fields
  • validateRateLimit validates the upper and lower bounds defined in the adapter, instead of the contract

Solution

  • use bigint for idCommitment instead of string
  • fix: getMembershipInfo to fetch, and return, ALL available data
  • fix: validate rate limits from contract

Notes


Checklist

  • Code changes are covered by unit tests.
  • Code changes are covered by e2e tests, if applicable.
  • Dogfooding has been performed, if feasible.
  • A test version has been published, if required.
  • All CI checks pass successfully.

Copy link

github-actions bot commented Apr 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 63.34 KB (-1.59% 🔽) 1.3 s (-1.59% 🔽) 4.3 s (-30.2% 🔽) 5.6 s
Waku Simple Light Node 116.97 KB (+0.09% 🔺) 2.4 s (+0.09% 🔺) 6.9 s (-6.01% 🔽) 9.2 s
ECIES encryption 23.13 KB (+0.54% 🔺) 463 ms (+0.54% 🔺) 2.5 s (-50.03% 🔽) 2.9 s
Symmetric encryption 22.53 KB (+0.41% 🔺) 451 ms (+0.41% 🔺) 3.5 s (+39.93% 🔺) 3.9 s
DNS discovery 50.75 KB (-0.15% 🔽) 1.1 s (-0.15% 🔽) 5.3 s (-7.32% 🔽) 6.3 s
Peer Exchange discovery 51.13 KB (-0.49% 🔽) 1.1 s (-0.49% 🔽) 5.1 s (+40.28% 🔺) 6.1 s
Local Peer Cache Discovery 44.49 KB (-0.47% 🔽) 890 ms (-0.47% 🔽) 4 s (-27.96% 🔽) 4.9 s
Privacy preserving protocols 51.99 KB (-1.93% 🔽) 1.1 s (-1.93% 🔽) 4.8 s (-15.56% 🔽) 5.9 s
Waku Filter 54.08 KB (-1.64% 🔽) 1.1 s (-1.64% 🔽) 4.8 s (-13.03% 🔽) 5.8 s
Waku LightPush 51.37 KB (-1.9% 🔽) 1.1 s (-1.9% 🔽) 4.4 s (-5.7% 🔽) 5.4 s
History retrieval protocols 51.63 KB (-1.84% 🔽) 1.1 s (-1.84% 🔽) 5.6 s (+23.38% 🔺) 6.6 s
Deterministic Message Hashing 7.28 KB (-0.68% 🔽) 146 ms (-0.68% 🔽) 1.8 s (-22.73% 🔽) 1.9 s

@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch 5 times, most recently from 197ba46 to d0da8f8 Compare April 14, 2025 08:26
@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch from a824fff to 08af18e Compare May 13, 2025 09:03
@danisharora099 danisharora099 marked this pull request as ready for review May 13, 2025 10:07
@danisharora099 danisharora099 requested a review from a team as a code owner May 13, 2025 10:07
@danisharora099 danisharora099 marked this pull request as draft May 13, 2025 10:08
@danisharora099 danisharora099 marked this pull request as ready for review May 13, 2025 14:45
@weboko
Copy link
Collaborator

weboko commented May 14, 2025

@danisharora099 can you create an issue capturing this problem(s)?

and can you, please, make PR name more informative?

}

// Initialize members and subscriptions
this.fetchMembers()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend to improve it even further and:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred inheritance in this specific example to avoid writing this delegation boilerplate: e8aa95f :D
Generally, composition >>

Copy link
Collaborator Author

@danisharora099 danisharora099 May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into some membership cache management issues when I tried to compose it instead of inherit -- seems like some tests need to be refactored

Creating a separate issue: #2392 -- will do it as a separate PR

@danisharora099
Copy link
Collaborator Author

@weboko can you please highlight which comments are blocking comments, and which are nits that aren't as important?

@danisharora099 danisharora099 requested a review from weboko May 19, 2025 10:49
@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch from a7f52e4 to 6d86b6f Compare May 19, 2025 12:14
@weboko weboko changed the title chore(rln): improvements feat: refine work with membership info and other meta information May 19, 2025
@@ -7,7 +7,7 @@ export type Password = string | Uint8Array;

// see reference
// https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L111
export type MembershipInfo = {
export type KeystoreMembershipInfo = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: what is the point of renaming?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were two instances of MembershipInfo :D

@weboko
Copy link
Collaborator

weboko commented May 26, 2025

can you please highlight which comments are blocking comments, and which are nits that aren't as important?

@danisharora099 I try to mark nit comment as nit and others we can at least discuss - here is comment that was ignored but raises important architectural change #2341 (comment)

@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch from 845bbfc to 9b71499 Compare May 28, 2025 12:09
@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch from e8aa95f to 7d63996 Compare May 28, 2025 12:25
@danisharora099 danisharora099 force-pushed the feat/rln-improvements branch from 7d63996 to a03cb71 Compare May 29, 2025 10:20
@danisharora099 danisharora099 merged commit 3b23bce into master May 29, 2025
11 checks passed
@danisharora099 danisharora099 deleted the feat/rln-improvements branch May 29, 2025 10:39
@weboko weboko mentioned this pull request May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: refine work with membership info and other meta information
2 participants